<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/common/taglibs.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<jsp:include page="/WEB-INF/jsp/common/include_easyui.jsp"></jsp:include>
<script type="text/javascript">

function saveData(){

	var isValid = jQuery("#modifyForm").form('validate');
	if(!isValid){
		jQuery("#modifyForm").form('enableValidation');
	}else{

		var saveURL = "<%=path%>/dataDictionaryMgrController/modifyDict?date="+new Date()+"";
		var paramObj = jQuery("#modifyForm").serializeArray();
		
		//alert(jQuery("#modifyForm").serialize())

		jQuery.post(saveURL,paramObj,function(responseData){
			
			var code = responseData.code;
			
			if (code == "200"){
				$.messager.alert('我的消息','数据字典信息修改成功！','info', function(){
					var parentWin = window.parent;
					parentWin.jQuery("#div_table").datagrid("reload");
					parentWin.jQuery('#dialog_div').dialog("close");
				});

			}else{
				$.messager.alert('我的消息',"数据保存出错，原因 ：" + responseData.message,'error');
			}
			
		},"json");
	}
	
	
	
	
}
</script>

<style type="text/css">


.modify-form div{
	margin-bottom:20px;
/* 	display: flex;
    justify-content:center; */
}
	

.modify-form div input{
	max-width: 400px;
	height:28px;
	width:100%;
}
</style>
  </head>
  
  <body>
		<form:form commandName="dict" id="modifyForm" method="post" class="modify-form">
			<div style="padding-left:12%;margin-top:20px;width: 80%;">
				<form:input class="easyui-textbox" path="id" readonly="true" labelAlign="right" data-options="label:'ID：',required:true"></form:input>
			</div>
			<div style="padding-left:12%;width: 80%;">
				<form:input class="easyui-textbox" path="type" labelAlign="right" data-options="label:'类别：',required:true"></form:input>
			</div>
			<div style="padding-left:12%;width: 80%;">
				<form:input class="easyui-textbox" path="item" labelAlign="right" data-options="label:'条目：',required:true"></form:input>
			</div>
			<div style="padding-left:12%;width: 80%;">
				<form:input class="easyui-textbox" path="value" labelAlign="right" data-options="label:'值：',required:true"></form:input>
			</div>
		</form:form>

  </body>
</html>
